# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from cemberus.html_meta.models import HtmlMeta, DateMeta


class UserProfile(HtmlMeta, DateMeta, models.Model):
    user = models.ForeignKey(User, unique = True, verbose_name = _('Benutzername'))
    
    # Store some extra User Information
    about = models.TextField(verbose_name = _(u'Über den Benutzer'), null = True, blank = True, help_text = _('Die Beschreibung wird unter <strong>jedem Blog Eintrag</strong> sowie auf der <strong>Profilseite</strong> erscheinen.'))
    city = models.CharField(verbose_name = _('Wohnort'), max_length = 80, null = True, blank = True)
    age = models.DateField(verbose_name = ('Alter'), null = True, blank = True, help_text = _('Das Geburtsdatum wird nur in Form des Alters auf der Profilseite angezeigt.'))
    job = models.CharField(verbose_name = _('Job'), max_length = 80, null = True, blank = True)
    homepage = models.URLField(verbose_name = _('Homepage'), verify_exists = False, max_length = 190, null = True, blank = True)
    avatar = models.ImageField(verbose_name = _('Avatar'), upload_to = 'user/avatar', null = True, blank = True)
    icq = models.IntegerField(verbose_name = _('ICQ UIN'), null = True, blank = True)
    skype = models.CharField(verbose_name = _('Skype Benutzername'), max_length = 60, null = True, blank= True)
    jabber = models.CharField(verbose_name = _('Jabber-Kennung'), max_length = 80, null = True, blank = True)
    facebook = models.URLField(verbose_name = _('Facebook Profilseite'), verify_exists = False, null = True, blank = True)
    twitter = models.URLField(verbose_name = _('Twitterseite'), verify_exists = False, null = True, blank = True)
    xing = models.URLField(verbose_name = _('XING Profil'), verify_exists = False, null = True, blank = True)
    lastfm = models.URLField(verbose_name = _('last.fm Profil'), verify_exists = False, null = True, blank = True)
    
    def __unicode__(self):
        return self.user.username
        
    class Meta:
        verbose_name = _(u'Benutzerprofil')
        verbose_name_plural = _(u'Benutzerprofile')
    
